//
// Decompiled by Jadx - 382ms
//
package fi;

import android.text.TextUtils;
import android.view.KeyEvent;
import android.widget.TextView;
import cc.h;
import cc.i;
import cc.j;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedHelpers;
import fo.b;
import fo.c;
import gc.aw;
import gj.k;
import java.util.HashMap;
import org.luckypray.dexkit.query.matchers.FieldMatcher;
import org.luckypray.dexkit.result.FieldData;

public final class p implements TextView.OnEditorActionListener {
    public final int a;
    public final Object b;

    public p(int i, Object obj) {
        this.a = i;
        this.b = obj;
    }

    @Override
    public final boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
        int i2 = this.a;
        Object obj = this.b;
        switch (i2) {
            case 0:
                i iVar = (i) obj;
                if (i != 6) {
                    return false;
                }
                iVar.e.performClick();
                return true;
            case 1:
                h hVar = (h) obj;
                if (i != 6) {
                    return false;
                }
                hVar.e.performClick();
                return true;
            case 2:
                j jVar = (j) obj;
                if (i != 6) {
                    return false;
                }
                jVar.e.performClick();
                return true;
            case 3:
                XC_MethodHook.MethodHookParam methodHookParam = (XC_MethodHook.MethodHookParam) obj;
                int i3 = aw.d.a;
                if (i != 4) {
                    return false;
                }
                String name = methodHookParam.thisObject.getClass().getName();
                HashMap hashMap = aw.cq;
                FieldData fieldData = (FieldData) hashMap.get(name);
                String e = b.e("_PasteEditText");
                if (TextUtils.isEmpty(e)) {
                    if (fieldData == null) {
                        fieldData = c.p(FieldMatcher.create().declaredClass(methodHookParam.thisObject.getClass()).type("cn.soulapp.android.square.view.PasteEditText"));
                        hashMap.put(name, fieldData);
                    }
                    e = fieldData.getFieldName();
                    b.g("_PasteEditText", e);
                }
                fn.j.ab(XposedHelpers.getObjectField(methodHookParam.thisObject, aw.cp.getFieldName()), "onSendMessage", new Object[]{((TextView) XposedHelpers.getObjectField(methodHookParam.thisObject, e)).getText().toString()});
                return true;
            default:
                k kVar = (k) obj;
                if (i == 6) {
                    kVar.e.e.setText("");
                    kVar.e.c.performClick();
                    return true;
                }
                kVar.getClass();
                return false;
        }
    }
}
